package com.ruoyi.workflow.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 流程定义对象 bus_bpmn_info
 * 
 * @author xiaodu
 * @date 2023-06-17
 */
@Getter
@Setter
@TableName("bus_bpmn_info")
public class BpmnInfo extends BaseEntity
{
    /**
     * 主键 ID
     */
    @TableId(type=IdType.AUTO)
    private Long id;
    /**
     * 审核类型val
     */
    private String bpmnLabel;
    /**
     * 审核类型key
     */
    private String bpmnType;
    /**
     * 流程定义key
     */
    private String processDefineKey;
    /**
     * 流程部署ID
     */
    private String deploymentId;

    /**
     * 流程部署时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date deployTime;
    /**
     * 版本号
     */
    private Integer version;
    /**
     * 备注
     */
    private String info;


    /**
     * 文件上传的名称
     */
    @TableField(exist = false)
    private String fileName;
    /**
     * 图片上传的名称
     */
    @TableField(exist = false)
    private String imgName;

    //当有有参构造函数必须提供无参，否则mybatis在select时会实例化该对象，通过反射把值设置到属性，不然会报各种类型的错误
    public BpmnInfo() {
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("bpmnLabel", getBpmnLabel())
            .append("bpmnType", getBpmnType())
            .append("processDefineKey", getProcessDefineKey())
            .append("deployTime", getDeployTime())
            .append("version", getVersion())
            .append("info", getInfo())
            .toString();
    }
}
